// problems with difficulty 1 are those that can only be solved 
// by 1 solver in TIME_LIMIT
// this file outputs how many problems with difficulty 1 are
// solved by each_solver 

#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <complex>
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
using namespace std;

short NUM_OF_SOLVERS; 
short NUM_OF_PROBLEMS;
double TIME_LIMIT;

vector<vector<double> > table;

vector<string> split(string& str, char sep ) {
	vector< string > ret;
	string::iterator from( str.begin() );
    int i = 0;
    while( true ) {
		string::iterator to = find( from, str.end(), sep );
        if( to == str.end() ) {
            string temp(from,to);
			ret.push_back( temp );
            break;
        } else {
			string temp(from,to);
            ret.push_back( temp );
            from = ++to;
        }
        i++;
    }
	return ret;
}

int main(){
    
    double time;
    
    int difficulty[3000];

    int lv1_solver[30];

    int level[30];
    
    freopen("ga.in","r",stdin);freopen("lv1_solver.out","w",stdout);

    vector<string> solverNames;
    
    string solverName = "auto|blast|simp|fast|best|force|fastsimp|meson|metis";
    solverNames = split(solverName, '|');

    memset(difficulty,0,sizeof(difficulty));
    memset(level,0,sizeof(level));
    memset(lv1_solver,0,sizeof(lv1_solver));

    vector<double> line;

    // Reading The Constants
    cin >> NUM_OF_SOLVERS; 
    cin >> NUM_OF_PROBLEMS;
    cin >> TIME_LIMIT;

    // Reading The Table
    for (int i = 0; i < NUM_OF_SOLVERS; i ++ ){
        for (int j = 0; j < NUM_OF_PROBLEMS; j ++ ){
            cin >> time;
            line.push_back(time);
            if ( time <= TIME_LIMIT) {
                difficulty[j] ++;            
            }             
        }
        table.push_back(line);
        line.clear();
    }

    for (int i = 0; i < NUM_OF_PROBLEMS; i ++ ){
        if (difficulty[i] == 1){
            for (int j = 0; j < NUM_OF_SOLVERS; j ++ ){
                if (table[j][i] <= TIME_LIMIT)
                    lv1_solver[j]++;
            }
        }
    }

    for (int i = 0; i < NUM_OF_SOLVERS; i ++ ){
        cout << solverNames[i] << ": " << lv1_solver[i] << endl;
    }

}
